package com.apartment.dao;

import com.apartment.data.entity.Apartment;
import com.apartment.data.entity.Landlord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Author : xuzhiyong
 * Date : 2022/6/2 15:34
 */
public interface ApartmentDao extends JpaRepository<Apartment,Integer> {

    @Query(value = "select a.id,a.landlord_id,a.address,a.apartment_type,a.apartment_statu,a.content,a.picture,a.price,a.username from Apartment a where a.landlord_id=?1",nativeQuery = true)
    List<Apartment> findApartmentByLandlordId(String id);
}
